<#include "/pages/manage/role/left.html"/>
<!--<div class="rs_layout_right" style="width:300px;"></div>-->
<div class="rs_layout_center">
	<div class="rs_layout">
		<div class="rs_layout_center">
			<div class="tableScrollWrap">
				<div class="rightCon">
				<div style="height: 389px;" class="rightList">
					<div style="margin-top:0px;" class="listCon">
						<ul class="nav_tapWrap nav_tabwps_4">
							<li class="nav_tapIthems cur"><a href="/${orgi}/manage/role/list/${roleid}/${groupid!''}.html"><i class="tabIcon tabicon-2"></i>用户</a></li>
							<li class="nav_tapIthems "><a href="/${orgi}/manage/role/rolelevel/${roleid}/${groupid!''}.html"><i class="tabIcon tabicon-6"></i>权限</a></li>
						</ul>
					</div>
					<form method="post" action="" id="roleUserForm" class="form-horizontal">
						<input type="hidden" value="" name="roleid" id="roleid"> 
						<input type="hidden" value="${roleid}" name="old_roleid" id="old_roleid"> 
						<input type="hidden" id="beginNum" name="beginNum" value="">
						<input type="hidden" id="endNum" name="endNum" value="">
						<input type="hidden" id="action" name="action" value="current">
						<div class="nav_tabwps_4con">
							<div class="nav_tabwps_4_layouts show" style="padding:0;">								
								<table class="table_style_1">
								<thead>
									<tr>
										<th></th>
										<th><i class="verMidWrap">名称</i><i class="tbArrow"></i></th>
										<th><i class="verMidWrap">部门</i><i class="tbArrow"></i></th>
										<th class="minSize"><i class="verMidWrap">电子邮件</i><i class="tbArrow"></i></th>
										<th class="minSize minIsHide"><i class="verMidWrap">姓名</i><i class="tbArrow"></i></th>
										<th class="minSize">操作</th>
									</tr>
								</thead>
								<tbody>
									
									<#if useroleList??>
									<#list useroleList as ou>
									<tr>
										<td class="tdIcons"><input name="userids" value="${ou.user.id!''}" type="checkbox"></td>
										<td><a href="javascript:void(0)"><i class="icons_tablelist_user"></i>${ou.user.username!''}</a></td>
										<td>${ou.user.department!''}</td>
										<td>${ou.user.email!''}</td>
										<td class="minSize">${ou.user.nickname!''}</td>
										<td class="minSize">
											<a title="删除用户" href="javascript:void(0)" onclick="art.confirm('您确定要从此角色中移除用户？' , function(){location.href='/${orgi}/manage/role/${ou.roleid!''}/roleuserdelo/${ou.user.id!''}.html'} , function(){})"><i class="tbControlIcon tci-6"></i></a>
										</td>
									</tr> 
									</#list>
									</#if>
								</tbody>
							</table>
							</div>
						
					</div></form>
				</div>
			</div>
			</div>
			
			
		</div>
		
		<div class="rs_layout_bottom toolBar_bottom" style="overflow: hidden">
			<div class="papers_1" style="float:left;line-height:18px;margin:0 10px 0 500px;">
				<span ><label style="font-size: 13px;">条目&nbsp;&nbsp;&nbsp;&nbsp;</label><input type="text" style="width: 30px;height: 10px;" id="beginNumShow" value="${beginNum!'1'}"/><label style="font-size: 13px;">-</label><input style="width: 30px;height: 10px;" type="text" id="endNumShow" value="${endNum!'20'}"/></span>
				<img class="pageElems" onclick="submitSearchForm('current');" title="查询" alt="查询" src="/assets/images/action_go.gif"/>
				<img class="pageElems" onclick="submitSearchForm('first');" title="首页" alt="首页" src="/assets/images/go-first-view.png"/>
				<img class="pageElems" onclick="submitSearchForm('last');" title="上一页" alt="上一页" src="/assets/images/go-previous-view.png"/>			
				<img class="pageElems" onclick="submitSearchForm('next');" title="下一页" alt="下一页" src="/assets/images/go-next-view.png"/>
				<img class="pageElems" onclick="submitSearchForm('final');" title="尾页" alt="尾页" src="/assets/images/go-last-view.png"/>
			</div>
			<ul class="toolbarBottom_IconWrap">
				<li class="tb-icons-1" onclick="submitRoleDoForm('rolecopy')" title="复制用户角色"></li>
				<li class="tb-icons-2" onclick="submitRoleDoForm('rolemove')" title="移动用户角色"></li>
				<li class="tb-icons-1" style="display: none" data-toggle="ajax" id="rolecopy" data-width="480" href="/${orgi}/manage/role/rolecopy.html" title="复制用户角色"></li>
				<li class="tb-icons-2" style="display: none" data-toggle="ajax" id="rolemove" data-width="480" href="/${orgi}/manage/role/rolemove.html" title="移动用户角色"></li>
				<li onclick="submitLevelUserDelForm();" class="tb-icons-4"></li>
			</ul>
		</div>
	</div>
</div>
<script type="text/javascript">
function submitRoleDoForm(id){
	if($("input[name='userids']:checked").length>0){
		$("#"+id).click();
	}else{
		alertMsg("请选择要操作的角色用户！");
	}
}
function submitRoleCopyForm(){
	$("#roleid").val($("input[name='roleids']:checked").val());
	if($("#roleid").val()!=""){
		$("#roleUserForm").attr("action","/${orgi}/manage/role/rolecopylist.html");
		$("#roleUserForm").submit();
	}else{
		alertMsg("请选择目标角色。");
	}
	
}
function submitRoleMoveForm(){
	$("#roleid").val($("input[name='roleids']:checked").val());
	if($("#roleid").val()!=""){
		$("#roleUserForm").attr("action","/${orgi}/manage/role/rolemovelist.html");
		$("#roleUserForm").submit();
	}else{
		alertMsg("请选择目标角色。");
	}
	
}
function submitLevelUserDelForm(){
	if($("input[name='userids']:checked").length>0){
		art.confirm('您确定要删除这些用户的管理权限吗？' 
		, function(){
			$("#roleUserForm").attr("action","/${orgi}/manage/role/${roleid}/roleuserdellist.html");
			$("#roleUserForm").submit();
		} , function(){})
		
	}else{
		alertMsg("请选择要删除的用户！");
	}
	
}
function submitSearchForm(action){
	$("#beginNum").val($("#beginNumShow").val());
	$("#endNum").val($("#endNumShow").val());
	$("#action").val(action);
	$("#roleUserForm").submit();
} 
</script>